package com.sso.service.impl;

import com.sso.entity.User;
import com.sso.feign.UserFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;

@Service
public class UserImpl {
    @Autowired
    private UserFeignService userFeignService;
    public User get(){
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        String name = authentication.getName();
        System.out.println(name);
        User user = userFeignService.get(name);
        return user;
    }
}
